function favClick(video){
    if(checkLogin()){
        app_collections.$data.modal_video = video;
        app_collections.$data.saved_success = false;
        app_collections.$data.saved_favorite = null;
        app_collections.$data.keyword = '';
        app_collections.$data.is_create_collection = false;
        $('#addCollectionModal').modal('show');
    }
    
}

(function() {
    var cardWidth = 0;
    var cardHeight = 0;
    if($(document).find('.video-card').length) {
        cardWidth = $('.video-card')[0].clientWidth;
        cardHeight = $('.video-card')[0].clientHeight;
    }

    $(document).on('mouseenter', '.video-card', function (e){
        if($(this).attr('style')){
            const column = $(this).attr('data-columns');
            const line = $(this).attr('data-lines');
            $(this).css('background-size', cardWidth*column+'px '+cardHeight*line+'px').find('.video-cover').addClass('d-none');
        }
    })
    $(document).on('mousemove', '.video-card', function (e){
        if($(this).attr('style')){
            e.preventDefault();
            const ox = e.clientX - $(this).offset().left;
            const column = $(this).attr('data-columns');
            const line = $(this).attr('data-lines');
            var itemW = cardWidth / (column * line);
            var index = Math.floor(ox / itemW);
            var lineIndex = Math.floor(index / column);
            $(this).css('background-position', '-'+cardWidth*index+'px');
            $(this).css('background-position-y', '-'+cardHeight*lineIndex+'px');

            $(this).find('.card-line').css('left', ox).addClass('show');//样式无
        }

    });
    $(document).on('mouseleave', '.video-card', function (e){
        if($(this).attr('style')) {
            $(this).find('.video-cover').removeClass('d-none');
            $(this).find('.card-line').css('left', -1).removeClass('show');//样式无
        }
    });
})()